package com.example.expedition.data.modules.finance.service;

import com.example.expedition.data.common.utils.UUIDUtils;
import com.example.expedition.data.modules.finance.dao.BalanceDescriptionMapper;
import com.example.expedition.data.modules.finance.entity.BalanceDescription;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * 描述：
 *
 * @author zengyz
 * @date 2018/8/22 16:01
 */
@Service
@Transactional(rollbackFor = {Exception.class, RuntimeException.class})
public class BalanceDescriptionService {

    @Autowired
    private BalanceDescriptionMapper balanceDescriptionMapper;

    public int add(BalanceDescription balanceDescription){
        balanceDescription.setId(UUIDUtils.getUUID32());
        balanceDescription.setCreateTime(new Date());
        return balanceDescriptionMapper.insert(balanceDescription);
    }
}
